VtFileSelectionDialog


Create a FileSelection dialog for the current directory

Syntax

VtFileSelectionDialog object_name [options]

Description

Creates a FileSelection dialog which displays a list of directories and files for the current directory. The user can select a file from the list or type in the text area. It also allows the user to switch to other directories. The lists are automatically updated to show the list of files and directories in the current directory. Returns the widget name.

By default, File Selection dialogs have an OK, Cancel, Help and Filter button. The Filter button is used to switch directories. You can choose whether you want the OK, Cancel and Help buttons, by using the options -ok, -cancel, and -help (see VtMessageDialog). The Filter button is always present.

If the user chooses either the OK or Cancel button, the dialog is automatically popped down and destroyed. To override this default, -autoHide and -autoDestroy options can be used.

Options

-dirListLabel string (CS)
Sets the label of the directory list box to string.

-fileListLabel string (CS)
Sets the label of the file list box to string.

-filter string (CS)
Sets the pattern used for filtering files (for example, /etc/default/*).

-filterLabel string (CS)
Sets the label over the box where the user can type in a filter to string.

-hideDirList (CS)
Do not display the directory list.

-hideFilter (CS)
Do not display the filter text.

-selection string (CS)
Sets the value of the filename in the filename text widget to string.

-selectionLabel string (CS)
Sets the label over the box where the user can type in a selection.

Example

The following code produces a File Selection dialog box with the default labels redefined, and the Filter disabled.

set app [VtOpen "File Selection Dialog Demo"]

VtFileSelectionDialog $app.demo \ 
	-dirListLabel "Vegetables" \
	-fileListLabel "Fruits" \
	-hideFilter \
	-selectionLabel "Choose your favorite food:" \
	-selection "mushy peas"

VtShowDialog $app.demo
VtMainLoop

This code produces the following:

See also: